import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class TestA {
    public static void main(String[] args) {
        String str;
        char max;
        char nor;
        char min;
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            str = sc.next();
            min = str.charAt(0);
            max = str.charAt(0);
            nor = str.charAt(0);
            for (int i = 0; i < str.length(); i++) {
                if (str.charAt(i) > max) {
                    max = str.charAt(i);
                }
            }
            for (int i = 0; i < str.length(); i++) {
                if (str.charAt(i) < min) {
                    min = str.charAt(i);
                }
            }
            for (int i = 0; i < str.length(); i++) {
                if (str.charAt(i) < max && str.charAt(i) > min) {
                    nor = str.charAt(i);
                }
            }
            System.out.println(min + " " + nor + " " + max);
        }
    }
}
